package com.zc.angelica.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 * 菜单信息表
 * @TableName menu_info
 */
@Data
public class MenuInfo implements Serializable {
    /**
     * 唯一标识
     */
    private Long id;

    /**
     * 父级id
     * */
    private Long parentId;

    /**
     * 菜单名称
     */
    private String menuName;

    /**
     * 菜单code
     */
    private String menuCode;

    /**
     * 菜单图标
     */
    private String manuIcon;

    /**
     * 父级菜单
     */
    private String parentCode;

    /**
     * 菜单类型（1本地菜单  2 url菜单）
     */
    private Integer menuType;

    /**
     * 菜单路径
     */
    private String menuUrl;

    /**
     * 菜单顺序
     */
    private Integer menuSort;

    /**
     * 平台code
     */
    private String platformCode;


    /**
     * 绑定 （1 未绑定 2已绑定）
     * */
    @TableField(exist = false)
    private Integer binding = 1;



    private static final long serialVersionUID = 1L;



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MenuInfo other = (MenuInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMenuName() == null ? other.getMenuName() == null : this.getMenuName().equals(other.getMenuName()))
            && (this.getMenuCode() == null ? other.getMenuCode() == null : this.getMenuCode().equals(other.getMenuCode()))
            && (this.getManuIcon() == null ? other.getManuIcon() == null : this.getManuIcon().equals(other.getManuIcon()))
            && (this.getParentCode() == null ? other.getParentCode() == null : this.getParentCode().equals(other.getParentCode()))
            && (this.getMenuType() == null ? other.getMenuType() == null : this.getMenuType().equals(other.getMenuType()))
            && (this.getMenuUrl() == null ? other.getMenuUrl() == null : this.getMenuUrl().equals(other.getMenuUrl()))
            && (this.getMenuSort() == null ? other.getMenuSort() == null : this.getMenuSort().equals(other.getMenuSort()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMenuName() == null) ? 0 : getMenuName().hashCode());
        result = prime * result + ((getMenuCode() == null) ? 0 : getMenuCode().hashCode());
        result = prime * result + ((getManuIcon() == null) ? 0 : getManuIcon().hashCode());
        result = prime * result + ((getParentCode() == null) ? 0 : getParentCode().hashCode());
        result = prime * result + ((getMenuType() == null) ? 0 : getMenuType().hashCode());
        result = prime * result + ((getMenuUrl() == null) ? 0 : getMenuUrl().hashCode());
        result = prime * result + ((getMenuSort() == null) ? 0 : getMenuSort().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", menuName=").append(menuName);
        sb.append(", menuCode=").append(menuCode);
        sb.append(", manuIcon=").append(manuIcon);
        sb.append(", parentCode=").append(parentCode);
        sb.append(", menuType=").append(menuType);
        sb.append(", menuUrl=").append(menuUrl);
        sb.append(", menuSort=").append(menuSort);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}